
<div ng-controller="PurchaseCtrl">
	
<div ng-include="'/templates/paramsSelect.html'"></div>
	<div class="page-heading">
		<ul class="breadcrumb">
			<li><a href="javascript:;">报表管理</a></li>
			<li><a href="javascript:;">配件报表</a></li>
			<li class="active" ng-hide="menuName">配件采购入库统计</li>
			<li class="active" ng-show="menuName" ng-bind="menuName"></li>
			<span style="margin-right:10px;"  class="btn btn-danger btn-xs pull-right btn-flag " ng-show="flag" ng-click="delFlag('/parts/purchase1/')"><i class="fa fa-times"></i> 删除 </span>
			<span style="margin-right:10px;"  class="btn btn-info btn-xs pull-right btn-flag " ng-click="addFlag('#/parts/purchase1/')"><i class="fa fa-star"></i> 收藏 </span>
		
		</ul>
	</div>
	<!-- 页面头部  end-->

	<!--页面内容显示区域-->
	<div class="wrapper">


		<div class="row">
			<div class="col-sm-12">
				<!--表格显示区域-->
				<section class="panel">
					<!--区块头 显示表格名称和功能按钮-->
					<header class="panel-heading">
						配件采购入库统计查询条件
						<!--控制按钮-->
						<span class="tools pull-right"> <!--收起-->
							<button type="button" class="btn btn-success pull-left" ng-click="SearchData()" 
							style="margin-left: 5px;">
								<i class="fa fa-search"></i> 查询
							</button>
							<button type="button" class="btn btn-info  pull-left" ng-click="ExportData()" 
							style="margin-left: 5px;">
								<i class="fa fa-table"></i> 导出EXCEL
							</button> <a href="javascript:;" class="fa fa-chevron-up form_display"></a>

						</span>
					</header>
					<!--区块body 显示表格内容-->
					<div class="panel-body form-horizontal form_hide">
						<div class="row">
                        	 
                        	<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">事业部</label>
										<div class="col-lg-8 col-sm-7">
										<input type="text" id="group_name" ng-keyup="clearGroup()"  name="group_name"   class="form-control select_edit form_params" />
                                            <ul class="select_list">
                                                  <li ng-repeat="e in groups" ng-click='LoadBrands(e.group_name)' val_code="{{e.group_name}}" val_name="{{e.group_name}}">{{e.group_name}}</li>
                                            </ul>  
                                            </div>
								</div>
							</div>
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">店面品牌</label>
									<div class="col-lg-8 col-sm-7">
										<input type="text" id="entity_brand_name"  ng-keyup="clearGroupBrand()"  name="entity_brand_name" class="form-control select_edit form_params" value=""/>
                                            <ul class="select_list">
                                                  <li ng-repeat="e in gBrands" ng-click='LoadEntitys(e)' val_code="{{e.brand_code}}" val_name="{{e.brand_name}}">{{e.brand_name}}</li>
                                            </ul> 
									</div>
								</div>
							</div>
							
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label" for="inputEmail1">店面信息</label>
									<div class="col-lg-8 col-sm-7">
											<input type="text" id="entity_name" ng-keyup="clearGroupBrandEntity()"  name="entity_name" class="form-control select_edit form_params" value=""/>
                                            <ul class="select_list">
                                                  <li ng-repeat="e in entitys" ng-click='LoadEntityLevel(e)' val_code="{{e.entity_code}}" val_name="{{e.entity_name}}">{{e.entity_name}}({{e.entity_code}})</li>
                                            </ul>  
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">客户代码</label>
									<div class="col-lg-8 col-sm-7">
										<select id="customer_code" name="customer_code" disabled class="js-data-example-ajax form-control form_params ">
											 <option value="" selected="selected"></option>
										</select>
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">配件代码</label>
									<div class="col-lg-8 col-sm-7">
										<input name="part_no" type="text" class="form-control form_params">
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">入账日期</label>
									<div class="col-lg-8 col-sm-7">
										<div data-date-format="yyyy-mm-dd" data-date="2016-5-15" class="input-large custom-date-range ">
											<input type="text" name="found_date1" class="form-control form_params" id="found_date1" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'found_date2\')||\'2020-10-01\'}'})">
										</div>
									</div>
								</div>
							</div>
                            
                            <div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label text-center" for="inputEmail1">至</label>
									<div class="col-lg-8 col-sm-7">
										<div data-date-format="yyyy-mm-dd" data-date="2016-5-15" class="input-large custom-date-range">
											 <input type="text" name="found_date2" class="form-control form_params" id="found_date2" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'found_date1\')}',maxDate:'2020-10-01'})">
										</div>
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">客户名称</label>
									<div class="col-lg-8 col-sm-7">
										<input name="customer_name" type="text" class="form-control form_params">
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">二级类别</label>
									<div class="col-lg-8 col-sm-7">
                                            <select name="sub_group_name" class="form-control form_params" ng-model="subGroupName"  ng-change="loadThird(subGroupName)" >
												<option></option>
												<option   ng-repeat="b in sub_list" value="{{b.name}}" val_code="{{b.code}}">{{b.name}}</option>
										    </select>
                                    </div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">三级类别</label>
									<div class="col-lg-8 col-sm-7">
									       <select name="third_group_name" class="form-control form_params" ng-model="thirdGroupName" ng-change="loadFourth(thirdGroupName)" >
												<option></option>
												<option   ng-repeat="b in third_list_sel" value="{{b.name}}">{{b.name}}</option>
										    </select>
									</div>
								</div>
							</div>
							
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">四级类别</label>
									<div class="col-lg-8 col-sm-7">
										    <select name="fourth_group_name" class="form-control form_params" >
										 		<option></option>
												<option  ng-repeat="b in fourth_list_sel" value="{{b.name}}">{{b.name}}</option>
										    </select>
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">注册号码</label>
									<div class="col-lg-8 col-sm-7">
										<input name="order_regedit_no" type="text" class="form-control form_params">
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">九大类</label>
									<div class="col-lg-8 col-sm-7">
										<select name="part_main_type_str" class="form-control form_params">
											<option></option>
											<option ng-repeat="b in partmain_list" value="{{b.status_desc}}">{{b.status_desc}}</option>
										</select>
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">配件类别</label>
									<div class="col-lg-8 col-sm-7">
										<select name="part_group_code" class="form-control form_params">
											<option></option>
											<option  ng-repeat="b in part_type" value="{{b.status_code}}">{{b.status_desc}}</option>
										</select>
										
									</div>
								</div>
							</div>
							
						</div>
					</div>
				</section>

				<section class="panel">
					<!--区块头 显示表格名称和功能按钮-->
					<header class="panel-heading">
						配件采购入库统计报表
						<headshow></headshow>
						<div class="option_check_list" style="display: inline-block;"></div>

						<!--控制按钮-->
						<span class="tools pull-right"> <!--收起--> <a
							href="javascript:;" class="fa fa-chevron-down"></a>
						</span>
						<div class="pull-right"
							style="margin-right: 10px; margin-top: -6px; display: inline-block">
							<button type="button" class="btn btn-danger btn-sm " href="#paramsSelect"
								data-toggle="modal">
								<i class="fa fa-plus"></i> 在结果集中筛选
							</button>
							<button type="button" class="btn btn-success btn-sm"
								id="search_table" ng-click="SearchData();">
								<i class="fa fa-search"></i> 查询表格
							</button>
						</div>
					</header>
					<!--区块body 显示表格内容-->
					<div class="panel-body form-horizontal ">

						<div class="adv-table" style="overflow-x: scroll">
							<table id="purchaseTable"
								class="table table-striped  nowrap  dataTable no-footer table_store table-hover float_head"
								cellspacing="0" width="100%">
								<thead>
									<tr>
										<th ng-show="!cols.contains('index')" column="index">序号</th>
										<th ng-show="!cols.contains('entity_code')" column="entity_code">店面编号</th>
										<th ng-show="!cols.contains('entity_name')" column="entity_name">店面名称</th>
										<th ng-show="!cols.contains('entity_brand_name')" column="entity_brand_name">店面品牌</th>
										<th ng-show="!cols.contains('group_name')" column="group_name">事业部</th>
										<th ng-show="!cols.contains('stock_in_no')" column="stock_in_no">入库单号</th>
										<th ng-show="!cols.contains('biz_seq')" column="biz_seq">流水号</th>
										<th ng-show="!cols.contains('storage_name')" column="storage_name">仓库</th>
										<th ng-show="!cols.contains('storage_position_code')" column="storage_position_code">库位</th>
										<th ng-show="!cols.contains('order_regedit_no')" column="order_regedit_no">注册号码</th>
										<th ng-show="!cols.contains('part_no')" column="part_no">配件代码</th>
										<th ng-show="!cols.contains('part_group_code_str')" column="part_group_code_str">配件类别</th>
										<th ng-show="!cols.contains('sub_group_name')" column="sub_group_name">二级类别</th>
										<th ng-show="!cols.contains('third_group_name')" column="third_group_name">三级类别</th>
										<th ng-show="!cols.contains('fourth_group_name')" column="fourth_group_name">四级类别</th>
										<th ng-show="!cols.contains('part_name')" column="part_name">配件名称</th>
										<th qtype='float' ng-show="!cols.contains('in_quantity')" column="in_quantity">入库数量</th>
										<th qtype='float' ng-show="!cols.contains('in_price')" column="in_price">不含税单价</th>
										<th qtype='float' ng-show="!cols.contains('in_amount')" column="in_amount">不含税金额</th>
										<th qtype='float' ng-show="!cols.contains('in_price_taxed')" column="in_price_taxed">含税单价</th>
										<th qtype='float' ng-show="!cols.contains('in_amount_taxed')" column="in_amount_taxed">含税金额</th>
										<th ng-show="!cols.contains('part_main_type_str')" column="part_main_type_str">九大类</th>
										<th qtype='date' ng-show="!cols.contains('finished_date')" column="finished_date">完成/入账日期</th>
										<th ng-show="!cols.contains('customer_code')" column="customer_code">客户代码</th>
										<th ng-show="!cols.contains('customer_name')" column="customer_name">客户名称</th>
										<th ng-show="!cols.contains('part_model_group_code_set')" column="part_model_group_code_set">配件车型组集</th>
										<th qtype='float' ng-show="!cols.contains('stock_quantity')" column="stock_quantity">账面库存</th>
										<th qtype='float' ng-show="!cols.contains('available_quantity')" column="available_quantity">可用库存</th>
										<th ng-show="!cols.contains('from_type_str')" column="from_type_str">来源方式</th>
										<th ng-show="!cols.contains('handler_str')" column="handler_str">经手人</th>
									</tr>
								</thead>
								<tbody>
									<tr ng-repeat="c in purchaseReports">
										<td ng-show="!cols.contains('index')" class="">{{$index + 1 }}</td>
										<td ng-show="!cols.contains('entity_code')" class="">{{c.entity_code}}</td>
										<td ng-show="!cols.contains('entity_name')" class="">{{c.entity_name}}</td>
										<td ng-show="!cols.contains('entity_brand_name')" class="">{{c.entity_brand_name}}</td>
										<td ng-show="!cols.contains('group_name')" class="">{{c.group_name}}</td>
										<td ng-show="!cols.contains('stock_in_no')" class="">{{c.stock_in_no}}</td>
										<td ng-show="!cols.contains('biz_seq')" class="">{{c.biz_seq}}</td>
										<td ng-show="!cols.contains('storage_name')" class="">{{c.storage_name}}</td>
										<td ng-show="!cols.contains('storage_position_code')" class="">{{c.storage_position_code}}</td>
										<td ng-show="!cols.contains('order_regedit_no')" class="">{{c.order_regedit_no}}</td>
										<td ng-show="!cols.contains('part_no')" class="">{{c.part_no}}</td>
										<td ng-show="!cols.contains('part_group_code_str')" class="">{{c.part_group_code_str}}</td>
										<td ng-show="!cols.contains('sub_group_name')" class="">{{c.sub_group_name}}</td>
										<td ng-show="!cols.contains('third_group_name')" class="">{{c.third_group_name}}</td>
										<td ng-show="!cols.contains('fourth_group_name')" class="">{{c.fourth_group_name}}</td>
										<td ng-show="!cols.contains('part_name')" class="">{{c.part_name}}</td>
										<td ng-show="!cols.contains('in_quantity')" class="">{{c.in_quantity | number:2}}</td>
										<td ng-show="!cols.contains('in_price')" class="">{{c.in_price | number:4}}</td>
										<td ng-show="!cols.contains('in_amount')" class="">{{c.in_amount | number:2}}</td>
										<td ng-show="!cols.contains('in_price_taxed')" class="">{{c.in_price_taxed | number:4}}</td>
										<td ng-show="!cols.contains('in_amount_taxed')" class="">{{c.in_amount_taxed | number:2}}</td>
										<td ng-show="!cols.contains('part_main_type_str')" class="">{{c.part_main_type_str}}</td>
										<td ng-show="!cols.contains('finished_date')" class="">{{c.finished_date | date:'yyyy-MM-dd'}}</td>
										<td ng-show="!cols.contains('customer_code')" class="">{{c.customer_code}}</td>
										<td ng-show="!cols.contains('customer_name')" class="">{{c.customer_name}}</td>
										<td ng-show="!cols.contains('part_model_group_code_set')" class="">{{c.part_model_group_code_set}}</td>
										<td ng-show="!cols.contains('stock_quantity')" class="">{{c.stock_quantity | number:2}}</td>
										<td ng-show="!cols.contains('available_quantity')" class="">{{(c.stock_quantity | number:2 - c.lend_quantity | number:2 - c.locked_quantity | number:2+ c.borrow_quantity| number:2) | number:2}}</td>
										<td ng-show="!cols.contains('from_type_str')" class="">{{c.from_type_str}}</td>
										<td ng-show="!cols.contains('handler_str')" class="">{{c.handler_str}}</td>
									</tr>

									<tr class="tbody_last_tr" ng-show="pagination.totalItems > 0">
										<td ng-show="!cols.contains('index')" class=""></td>
										<td ng-show="!cols.contains('entity_code')" class=""></td>
										<td ng-show="!cols.contains('entity_name')" class=""></td>
										<td ng-show="!cols.contains('entity_brand_name')" class=""></td>
										<td ng-show="!cols.contains('group_name')" class=""></td>
										<td ng-show="!cols.contains('stock_in_no')" class=""></td>
										<td ng-show="!cols.contains('biz_seq')" class=""></td>
										<td ng-show="!cols.contains('storage_name')" class=""></td>
										<td ng-show="!cols.contains('storage_position_code')" class=""></td>
										<td ng-show="!cols.contains('order_regedit_no')" class=""></td>
										<td ng-show="!cols.contains('part_no')" class=""></td>
										<td ng-show="!cols.contains('part_group_code_str')" class=""></td>
										<td ng-show="!cols.contains('sub_group_name')" class=""></td>
										<td ng-show="!cols.contains('third_group_name')" class=""></td>
										<td ng-show="!cols.contains('fourth_group_name')" class=""></td>
										<td ng-show="!cols.contains('part_name')" class=""></td>
										<td ng-show="!cols.contains('in_quantity')" class="">{{purchaseReportsSum.sum_in_quantity.value | number:2}}</td>
										<td ng-show="!cols.contains('in_price')" class=""></td>
										<td ng-show="!cols.contains('in_amount')" class="">{{purchaseReportsSum.sum_in_amount.value | number:2}}</td>
										<td ng-show="!cols.contains('in_price_taxed')" class=""></td>
										<td ng-show="!cols.contains('in_amount_taxed')" class="">{{purchaseReportsSum.sum_in_amount_taxed.value | number:2}}</td>
										<td ng-show="!cols.contains('part_main_type_str')" class=""></td>
										<td ng-show="!cols.contains('finished_date')" class=""></td>
										<td ng-show="!cols.contains('customer_code')" class=""></td>
										<td ng-show="!cols.contains('customer_name')" class=""></td>
										<td ng-show="!cols.contains('part_model_group_code_set')" class=""></td>
										<td ng-show="!cols.contains('stock_quantity')" class=""></td>
										<td ng-show="!cols.contains('available_quantity')" class=""></td>
										<td ng-show="!cols.contains('from_type_str')" class=""></td>
										<td ng-show="!cols.contains('handler_str')" class=""></td>
									</tr>
								</tbody>
							</table>
							<div class="no-items" ng-show="pagination.totalItems <= 0">暂无数据</div>
						</div>
						<tm-pagination conf="pagination"></tm-pagination>
					</div>
				</section>
				<!--表格显示区域-->

			</div>
		</div>
	</div>
</div>

<form id="export_form" action="purchase/export"  method="post">
	<input type="hidden" name="keys" id="keys" />
	<input type="hidden" name="names" id="names" /> 
	<input type="hidden" name="params" id="params" />
	<input type="hidden" name="search_opt" id="search_opt" /> 
	<input type="hidden" name="file_name" id="file_name" value="配件采购入库统计"/>
</form>



